<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试404接口</title>
</head>
<body>
    <h1>测试404接口</h1>
    
    <div>
        <h2>测试订单列表接口</h2>
        <button onclick="testOrderList()">测试 POST /agg/order/myPage</button>
        <div id="orderResult"></div>
    </div>
    
    <div>
        <h2>测试二维码接口</h2>
        <button onclick="testQRCode()">测试 GET /agg/qrcode/generateDownload</button>
        <div id="qrResult"></div>
    </div>

    <script>
        const BASE_URL = 'http://localhost:8080';
        const token = 'eyJhbGciOiJIUzI1NiJ9.eyJjcmVhdGVkIjoxNzYwND…DU1fQ.hlEbl4K4aVY6GlNz75e1OTwVaq0SQC6NevvEohV-Y10';

        async function testOrderList() {
            const resultDiv = document.getElementById('orderResult');
            resultDiv.innerHTML = '测试中...';
            
            try {
                const response = await fetch(`${BASE_URL}/agg/order/myPage`, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json',
                        'Authorization': `Bearer ${token}`
                    },
                    body: JSON.stringify({
                        pageIndex: 1,
                        pageSize: 10
                    })
                });
                
                const result = await response.text();
                resultDiv.innerHTML = `
                    <p><strong>状态码:</strong> ${response.status}</p>
                    <p><strong>响应:</strong> ${result}</p>
                `;
            } catch (error) {
                resultDiv.innerHTML = `<p style="color: red;">错误: ${error.message}</p>`;
            }
        }

        async function testQRCode() {
            const resultDiv = document.getElementById('qrResult');
            resultDiv.innerHTML = '测试中...';
            
            try {
                const response = await fetch(`${BASE_URL}/agg/qrcode/generateDownload`, {
                    method: 'GET',
                    headers: {
                        'Authorization': `Bearer ${token}`
                    }
                });
                
                const result = await response.text();
                resultDiv.innerHTML = `
                    <p><strong>状态码:</strong> ${response.status}</p>
                    <p><strong>响应:</strong> ${result}</p>
                `;
            } catch (error) {
                resultDiv.innerHTML = `<p style="color: red;">错误: ${error.message}</p>`;
            }
        }
    </script>
</body>
</html>
